//
//  ViewController.m
//  HXDemo
//
//  Created by 李亚军 on 16/11/21.
//  Copyright © 2016年 李亚军. All rights reserved.
//

#import "ViewController.h"
#import "ChatManager.h"
#import "ChatVC.h"
#import "LYJProgressHUD.h"

@interface ViewController ()



@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    

//    [self performSelector:@selector(actionPerform) withObject:nil afterDelay:8];
    
    
    self.isBack = NO;
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        NSLog(@"actionPerform");
        
        [self actionPerform];
    });
}

- (void)actionPerform {
    NSLog(@"isBack:%ld" , (long)self.isBack);
    
    self.isBack = [self.navigationController.interactivePopGestureRecognizer.delegate gestureRecognizerShouldBegin:nil];
    
    [LYJProgressHUD showWithStatus:@"Hello,我们又见面了" userInteractionEnabled:NO animation:YES];
    
//    if (!self.isBack) {
//        
//        [LYJProgressHUD showWithStatus:@"Hello,我们又见面了" userInteractionEnabled:NO animation:YES];
//    }
}

- (IBAction)backAction:(UIBarButtonItem *)sender {
    self.isBack = YES;
    [self.navigationController popViewControllerAnimated:YES];
}


- (IBAction)chatAction:(UIButton *)sender {

    
    ChatVC *chatVC = (ChatVC *)[[ChatManager shareChatManager] initializeViewControllerWithStoryboardName:@"Main" storyboardID:@"ChatVCID"];
    [self.navigationController pushViewController:chatVC animated:YES];

}



- (IBAction)ProgressHUDBottomVCAction:(UIButton *)sender {
    
    [LYJProgressHUD showWithStatus:@"你好,我是李亚军" userInteractionEnabled:YES animation:NO];

}

- (IBAction)statusWarningAction:(UIButton *)sender {
    
    [LYJProgressHUD showWithStatus:@"你好,我是李亚军" userInteractionEnabled:YES animation:NO];
}

- (IBAction)action1:(id)sender {
    
    [LYJProgressHUD showWithStatus:@"我是李亚军,hello,我是全局显示我有动画" userInteractionEnabled:NO animation:YES];
}

- (IBAction)action2:(id)sender {
    
    [LYJProgressHUD showWithStatus:@"我是李亚军,hello,我是全局显示,我没有动画" userInteractionEnabled:NO animation:NO];
}



- (IBAction)action:(UIButton *)sender {
    
    NSLog(@"我可以点击");
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc {
    
    NSLog(@"viewController销毁了");
}




@end
